<?php
require_once ('../../config/include_paths.php');
require_once('config.php');
require_once('dbconnect.php');	// database connect script.
$num_rows = 0;
if ($_POST) {
	$page_id = $_POST['page_id'];
	$enabled = $_POST['enabled'];
	$table = $_POST['table'];
}
	$query  = "SELECT * FROM users
				WHERE listInContacts = 1
				ORDER BY record_order ASC";

	$result = mysql_query($query);
	$num_rows = mysql_num_rows($result);
	
	while($row = mysql_fetch_array($result, MYSQL_ASSOC))
	{
?>
<li id="recordsArray_<?php echo $row['id']; ?>" class="ui-sortable">
  <span class="user" id="<?php echo $row['fname'];?>_fname"><?php echo $row['fname'];?></span>&nbsp;
  <span class="user" id="<?php echo $row['lname'];?>_lname"><?php echo $row['lname'];?></span>&nbsp;
  <span class="user" id="<?php echo $row['title'];?>_title"><?php echo $row['title'];?></span>&nbsp;
  <span class="user" id="<?php echo $row['email'];?>_title"><?php echo $row['email'];?></span>
  <span class="editModule">
  	<a href="userform.php?id=<?php echo $row['id']; ?>" title="Edit"><img src="../images/edit_button.png" /></a>
    <a href="deleteform.php?id=<?php echo $row['id']; ?>&table=users&returnTo=<?php echo $ifDeleteReturnTo ?>" title="Delete"><img src="../images/delete_button.png" /></a>
  </span>
</li>
<?php } ?>